#include <stdio.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <stdlib.h>
int main()
{
    printf("start\n");
    pid_t id = fork();
    if(id == 0)
    {
        printf("i am child process\n");
        //execlp("ls","ls","-a","-l",NULL);
        char* argv[] = {(char*)"ls",(char*)"-a",(char*)"-l",NULL};
        execv("/usr/bin/ls",argv);
        exit(1);
    }
    int status = 0;
    pid_t rid = waitpid(id,&status,0);
    if(rid == id)
    {
        printf("i am father process\n");
    }
    return 0;
}
